OLD_LOCAL_PATH := $(LOCAL_PATH)
LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_32_BIT_ONLY := $(BOARD_QTI_CAMERA_32BIT_ONLY)
LOCAL_CFLAGS+= -D_ANDROID_ -DQCAMERA_REDEFINE_LOG

LOCAL_CFLAGS += -Wall -Wextra -Werror -Wno-unused-parameter

IMGLIB_HEADER_PATH := $(TARGET_OUT_INTERMEDIATES)/include/mm-camera/imglib

LOCAL_C_INCLUDES += \
    $(IMGLIB_HEADER_PATH) \
    $(LOCAL_PATH)/inc \
    $(LOCAL_PATH)/../common \
    $(LOCAL_PATH)/../mm-camera-interface/inc \

LOCAL_HEADER_LIBRARIES := libutils_headers
ifeq ($(strip $(TARGET_USES_ION)),true)
    LOCAL_CFLAGS += -DUSE_ION
endif

LOCAL_HEADER_LIBRARIES += generated_kernel_headers

LOCAL_SRC_FILES := \
    src/mm_lib2d.c

LOCAL_MODULE           := libmmlib2d_interface
LOCAL_PRELINK_MODULE   := false
#LOCAL_SHARED_LIBRARIES := libdl libcutils liblog libmmcamera_interface
LOCAL_SHARED_LIBRARIES := libdl libcutils liblog
LOCAL_MODULE_TAGS := optional
LOCAL_VENDOR_MODULE := true

LOCAL_32_BIT_ONLY := $(BOARD_QTI_CAMERA_32BIT_ONLY)

MI8937_CAM_2DINTF_32_BIT_ONLY := $(LOCAL_32_BIT_ONLY)
MI8937_CAM_2DINTF_ADDITIONAL_DEPENDENCIES := $(LOCAL_ADDITIONAL_DEPENDENCIES)
MI8937_CAM_2DINTF_CFLAGS := $(LOCAL_CFLAGS)
MI8937_CAM_2DINTF_C_INCLUDES := $(LOCAL_C_INCLUDES)
MI8937_CAM_2DINTF_HEADER_LIBRARIES := $(LOCAL_HEADER_LIBRARIES)
MI8937_CAM_2DINTF_MODULE := $(LOCAL_MODULE)
MI8937_CAM_2DINTF_MODULE_TAGS := $(LOCAL_MODULE_TAGS)
MI8937_CAM_2DINTF_PRELINK_MODULE := $(LOCAL_PRELINK_MODULE)
MI8937_CAM_2DINTF_SHARED_LIBRARIES := $(LOCAL_SHARED_LIBRARIES)
MI8937_CAM_2DINTF_SRC_FILES := $(LOCAL_SRC_FILES)
MI8937_CAM_2DINTF_VENDOR_MODULE := $(LOCAL_VENDOR_MODULE)
include $(CLEAR_VARS)

include $(CLEAR_VARS)
LOCAL_32_BIT_ONLY := $(MI8937_CAM_2DINTF_32_BIT_ONLY)
LOCAL_ADDITIONAL_DEPENDENCIES := $(MI8937_CAM_2DINTF_ADDITIONAL_DEPENDENCIES)
LOCAL_CFLAGS := $(MI8937_CAM_2DINTF_CFLAGS)
LOCAL_C_INCLUDES := $(MI8937_CAM_2DINTF_C_INCLUDES)
LOCAL_HEADER_LIBRARIES := $(MI8937_CAM_2DINTF_HEADER_LIBRARIES)
LOCAL_MODULE_TAGS := $(MI8937_CAM_2DINTF_MODULE_TAGS)
LOCAL_PRELINK_MODULE := $(MI8937_CAM_2DINTF_PRELINK_MODULE)
LOCAL_SHARED_LIBRARIES := $(MI8937_CAM_2DINTF_SHARED_LIBRARIES)
LOCAL_SRC_FILES := $(MI8937_CAM_2DINTF_SRC_FILES)
LOCAL_VENDOR_MODULE := $(MI8937_CAM_2DINTF_VENDOR_MODULE)

ifeq ($(MI8937_CAM_USE_RENAMED_BLOBS_W),true)
LOCAL_CFLAGS += -DRENAME_BLOBS
endif

LOCAL_CFLAGS += -DODM_WINGTECH
LOCAL_SHARED_LIBRARIES += libWmcamera_interface
LOCAL_MODULE := libWmlib2d_interface
include $(BUILD_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_32_BIT_ONLY := $(MI8937_CAM_2DINTF_32_BIT_ONLY)
LOCAL_ADDITIONAL_DEPENDENCIES := $(MI8937_CAM_2DINTF_ADDITIONAL_DEPENDENCIES)
LOCAL_CFLAGS := $(MI8937_CAM_2DINTF_CFLAGS)
LOCAL_C_INCLUDES := $(MI8937_CAM_2DINTF_C_INCLUDES)
LOCAL_HEADER_LIBRARIES := $(MI8937_CAM_2DINTF_HEADER_LIBRARIES)
LOCAL_MODULE_TAGS := $(MI8937_CAM_2DINTF_MODULE_TAGS)
LOCAL_PRELINK_MODULE := $(MI8937_CAM_2DINTF_PRELINK_MODULE)
LOCAL_SHARED_LIBRARIES := $(MI8937_CAM_2DINTF_SHARED_LIBRARIES)
LOCAL_SRC_FILES := $(MI8937_CAM_2DINTF_SRC_FILES)
LOCAL_VENDOR_MODULE := $(MI8937_CAM_2DINTF_VENDOR_MODULE)

ifeq ($(MI8937_CAM_USE_RENAMED_BLOBS_U),true)
LOCAL_CFLAGS += -DRENAME_BLOBS
endif

LOCAL_CFLAGS += -DDEVICE_ULYSSE
LOCAL_SHARED_LIBRARIES += libUmcamera_interface
LOCAL_MODULE := libUmlib2d_interface
include $(BUILD_SHARED_LIBRARY)

LOCAL_PATH := $(OLD_LOCAL_PATH)
